# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Translate.V2.Model.TranslateTextRequest do
  @moduledoc """
  The main translation request message for the Cloud Translation API.

  ## Attributes

  *   `format` (*type:* `String.t`, *default:* `nil`) - The format of the source text, in either HTML (default) or plain-text. A
      value of "html" indicates HTML and a value of "text" indicates plain-text.
  *   `model` (*type:* `String.t`, *default:* `nil`) - The `model` type requested for this translation. Valid values are
      listed in public documentation.
  *   `q` (*type:* `list(String.t)`, *default:* `nil`) - The input text to translate. Repeat this parameter to perform translation
      operations on multiple text inputs.
  *   `source` (*type:* `String.t`, *default:* `nil`) - The language of the source text, set to one of the language codes listed in
      Language Support. If the source language is not specified, the API will
      attempt to identify the source language automatically and return it within
      the response.
  *   `target` (*type:* `String.t`, *default:* `nil`) - The language to use for translation of the input text, set to one of the
      language codes listed in Language Support.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :format => String.t() | nil,
          :model => String.t() | nil,
          :q => list(String.t()) | nil,
          :source => String.t() | nil,
          :target => String.t() | nil
        }

  field(:format)
  field(:model)
  field(:q, type: :list)
  field(:source)
  field(:target)
end

defimpl Poison.Decoder, for: GoogleApi.Translate.V2.Model.TranslateTextRequest do
  def decode(value, options) do
    GoogleApi.Translate.V2.Model.TranslateTextRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Translate.V2.Model.TranslateTextRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
